<?php if ( ! defined('BASEPATH')) exit('No se permite acceso directo vía scripts');
/**
 * Created by IntelliJ IDEA.
 * User: Luciano
 * Date: 31/10/13
 * Time: 23:38
 * To change this template use File | Settings | File Templates.
 */

class Direccion_model extends CI_Model{

	function Direccion_model(){
		$this->load->model('Tablas');
	}
	/* Devuelve el id obtenido */
	public function dirAlta($dir=null){
		$this->db->insert(Tablas::DIRECCION, $dir);
		return $this->db->insert_id();
	}
	public function dirBuscar($id=null){
		$this->db->where('id', $id);
		$query = $this->db->get(Tablas::DIRECCION);
		return $query->row();
	}
}